/**
 * PHOSIDE: PHosphorylation Site IDentification Engine.
 * Copyright 2009 Digital Biology Lab, University of Missouri.
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU General Public License as published by the Free Software
 * Foundation; either version 3 of the License, or (at your option) any later
 * version. <p/> This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more
 * details.
 */

package phoside.ui.task;

import cytoscape.task.Task;
import cytoscape.task.TaskMonitor;

/**
 *
 * @author gjj
 */
public abstract class AbstractTask implements Task {
    protected String title;
    protected TaskMonitor taskMonitor;
    protected boolean success;
    protected Object obj;

    public AbstractTask(String title) {
        this.title= title;
        success = false;
        obj = null;
    }

    public boolean success() {
        return success;
    }

    public Object getResultObject() {
        return obj;
    }

    /**
     * Halts the Task: Not Currently Implemented.
     */
    public void halt() {

    }

    /**
     * Sets the Task Monitor.
     *
     * @param taskMonitor
     *            TaskMonitor Object.
     */
    public void setTaskMonitor(TaskMonitor taskMonitor) throws IllegalThreadStateException {
            this.taskMonitor = taskMonitor;
    }

    /**
     * Gets the Task Title.
     *
     * @return Task Title.
     */
    public String getTitle() {
        return title;
    }
}
